#pragma once
// MESSAGE MISSION_HEARTBEAT_1HZ PACKING

#define MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ 12921


typedef struct __mavlink_mission_heartbeat_1hz_t {
 int64_t seq; /*<  seq序列号*/
 int32_t home_x_lat; /*<  home点纬度 = home_x_lat * 1e-7*/
 int32_t home_y_lon; /*<  home点经度 = home_y_lon * 1e-7*/
 int32_t home_z_alt; /*<  home点高度 = home_z_alt * 1e-3*/
 int32_t backup_home_lat; /*<  备降点0纬度 = backup_home_lat * 1e-7*/
 int32_t backup_home_lon; /*<  备降点0经度 = backup_home_lon * 1e-7*/
 int32_t backup_home_alt; /*<  备降点0高度 = backup_home_alt * 1e-3*/
 int32_t backup_home_valid; /*<  备降点有效,TRUE,Boolean*/
 int32_t start_time_s; /*<  启动时间*/
 uint8_t drone_type; /*<  飞机类型 DroneType*/
 uint8_t drone_id; /*<  飞机id*/
 uint8_t fcs_flight_mode; /*<  飞行模式FlightControlMode*/
 uint8_t fcs_arm; /*<  解锁状态bool*/
 uint8_t smart_mode; /*<  飞机工作模式，主模式.*/
 uint8_t smart_mode_status; /*<  工作状态*/
 uint8_t is_home_invalid; /*<  home点无效*/
 uint8_t fly_time_s; /*<  飞行时间*/
} mavlink_mission_heartbeat_1hz_t;

#define MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN 48
#define MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_MIN_LEN 48
#define MAVLINK_MSG_ID_12921_LEN 48
#define MAVLINK_MSG_ID_12921_MIN_LEN 48

#define MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_CRC 2
#define MAVLINK_MSG_ID_12921_CRC 2



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_MISSION_HEARTBEAT_1HZ { \
    12921, \
    "MISSION_HEARTBEAT_1HZ", \
    17, \
    {  { "seq", NULL, MAVLINK_TYPE_INT64_T, 0, 0, offsetof(mavlink_mission_heartbeat_1hz_t, seq) }, \
         { "drone_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_mission_heartbeat_1hz_t, drone_type) }, \
         { "drone_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_mission_heartbeat_1hz_t, drone_id) }, \
         { "fcs_flight_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_mission_heartbeat_1hz_t, fcs_flight_mode) }, \
         { "fcs_arm", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_mission_heartbeat_1hz_t, fcs_arm) }, \
         { "smart_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 44, offsetof(mavlink_mission_heartbeat_1hz_t, smart_mode) }, \
         { "smart_mode_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 45, offsetof(mavlink_mission_heartbeat_1hz_t, smart_mode_status) }, \
         { "is_home_invalid", NULL, MAVLINK_TYPE_UINT8_T, 0, 46, offsetof(mavlink_mission_heartbeat_1hz_t, is_home_invalid) }, \
         { "home_x_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_mission_heartbeat_1hz_t, home_x_lat) }, \
         { "home_y_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_mission_heartbeat_1hz_t, home_y_lon) }, \
         { "home_z_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_mission_heartbeat_1hz_t, home_z_alt) }, \
         { "backup_home_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_mission_heartbeat_1hz_t, backup_home_lat) }, \
         { "backup_home_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_mission_heartbeat_1hz_t, backup_home_lon) }, \
         { "backup_home_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 28, offsetof(mavlink_mission_heartbeat_1hz_t, backup_home_alt) }, \
         { "fly_time_s", NULL, MAVLINK_TYPE_UINT8_T, 0, 47, offsetof(mavlink_mission_heartbeat_1hz_t, fly_time_s) }, \
         { "backup_home_valid", NULL, MAVLINK_TYPE_INT32_T, 0, 32, offsetof(mavlink_mission_heartbeat_1hz_t, backup_home_valid) }, \
         { "start_time_s", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_mission_heartbeat_1hz_t, start_time_s) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_MISSION_HEARTBEAT_1HZ { \
    "MISSION_HEARTBEAT_1HZ", \
    17, \
    {  { "seq", NULL, MAVLINK_TYPE_INT64_T, 0, 0, offsetof(mavlink_mission_heartbeat_1hz_t, seq) }, \
         { "drone_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 40, offsetof(mavlink_mission_heartbeat_1hz_t, drone_type) }, \
         { "drone_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 41, offsetof(mavlink_mission_heartbeat_1hz_t, drone_id) }, \
         { "fcs_flight_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 42, offsetof(mavlink_mission_heartbeat_1hz_t, fcs_flight_mode) }, \
         { "fcs_arm", NULL, MAVLINK_TYPE_UINT8_T, 0, 43, offsetof(mavlink_mission_heartbeat_1hz_t, fcs_arm) }, \
         { "smart_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 44, offsetof(mavlink_mission_heartbeat_1hz_t, smart_mode) }, \
         { "smart_mode_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 45, offsetof(mavlink_mission_heartbeat_1hz_t, smart_mode_status) }, \
         { "is_home_invalid", NULL, MAVLINK_TYPE_UINT8_T, 0, 46, offsetof(mavlink_mission_heartbeat_1hz_t, is_home_invalid) }, \
         { "home_x_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_mission_heartbeat_1hz_t, home_x_lat) }, \
         { "home_y_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_mission_heartbeat_1hz_t, home_y_lon) }, \
         { "home_z_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_mission_heartbeat_1hz_t, home_z_alt) }, \
         { "backup_home_lat", NULL, MAVLINK_TYPE_INT32_T, 0, 20, offsetof(mavlink_mission_heartbeat_1hz_t, backup_home_lat) }, \
         { "backup_home_lon", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_mission_heartbeat_1hz_t, backup_home_lon) }, \
         { "backup_home_alt", NULL, MAVLINK_TYPE_INT32_T, 0, 28, offsetof(mavlink_mission_heartbeat_1hz_t, backup_home_alt) }, \
         { "fly_time_s", NULL, MAVLINK_TYPE_UINT8_T, 0, 47, offsetof(mavlink_mission_heartbeat_1hz_t, fly_time_s) }, \
         { "backup_home_valid", NULL, MAVLINK_TYPE_INT32_T, 0, 32, offsetof(mavlink_mission_heartbeat_1hz_t, backup_home_valid) }, \
         { "start_time_s", NULL, MAVLINK_TYPE_INT32_T, 0, 36, offsetof(mavlink_mission_heartbeat_1hz_t, start_time_s) }, \
         } \
}
#endif

/**
 * @brief Pack a mission_heartbeat_1hz message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param seq  seq序列号
 * @param drone_type  飞机类型 DroneType
 * @param drone_id  飞机id
 * @param fcs_flight_mode  飞行模式FlightControlMode
 * @param fcs_arm  解锁状态bool
 * @param smart_mode  飞机工作模式，主模式.
 * @param smart_mode_status  工作状态
 * @param is_home_invalid  home点无效
 * @param home_x_lat  home点纬度 = home_x_lat * 1e-7
 * @param home_y_lon  home点经度 = home_y_lon * 1e-7
 * @param home_z_alt  home点高度 = home_z_alt * 1e-3
 * @param backup_home_lat  备降点0纬度 = backup_home_lat * 1e-7
 * @param backup_home_lon  备降点0经度 = backup_home_lon * 1e-7
 * @param backup_home_alt  备降点0高度 = backup_home_alt * 1e-3
 * @param fly_time_s  飞行时间
 * @param backup_home_valid  备降点有效,TRUE,Boolean
 * @param start_time_s  启动时间
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_mission_heartbeat_1hz_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               int64_t seq, uint8_t drone_type, uint8_t drone_id, uint8_t fcs_flight_mode, uint8_t fcs_arm, uint8_t smart_mode, uint8_t smart_mode_status, uint8_t is_home_invalid, int32_t home_x_lat, int32_t home_y_lon, int32_t home_z_alt, int32_t backup_home_lat, int32_t backup_home_lon, int32_t backup_home_alt, uint8_t fly_time_s, int32_t backup_home_valid, int32_t start_time_s)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN];
    _mav_put_int64_t(buf, 0, seq);
    _mav_put_int32_t(buf, 8, home_x_lat);
    _mav_put_int32_t(buf, 12, home_y_lon);
    _mav_put_int32_t(buf, 16, home_z_alt);
    _mav_put_int32_t(buf, 20, backup_home_lat);
    _mav_put_int32_t(buf, 24, backup_home_lon);
    _mav_put_int32_t(buf, 28, backup_home_alt);
    _mav_put_int32_t(buf, 32, backup_home_valid);
    _mav_put_int32_t(buf, 36, start_time_s);
    _mav_put_uint8_t(buf, 40, drone_type);
    _mav_put_uint8_t(buf, 41, drone_id);
    _mav_put_uint8_t(buf, 42, fcs_flight_mode);
    _mav_put_uint8_t(buf, 43, fcs_arm);
    _mav_put_uint8_t(buf, 44, smart_mode);
    _mav_put_uint8_t(buf, 45, smart_mode_status);
    _mav_put_uint8_t(buf, 46, is_home_invalid);
    _mav_put_uint8_t(buf, 47, fly_time_s);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN);
#else
    mavlink_mission_heartbeat_1hz_t packet;
    packet.seq = seq;
    packet.home_x_lat = home_x_lat;
    packet.home_y_lon = home_y_lon;
    packet.home_z_alt = home_z_alt;
    packet.backup_home_lat = backup_home_lat;
    packet.backup_home_lon = backup_home_lon;
    packet.backup_home_alt = backup_home_alt;
    packet.backup_home_valid = backup_home_valid;
    packet.start_time_s = start_time_s;
    packet.drone_type = drone_type;
    packet.drone_id = drone_id;
    packet.fcs_flight_mode = fcs_flight_mode;
    packet.fcs_arm = fcs_arm;
    packet.smart_mode = smart_mode;
    packet.smart_mode_status = smart_mode_status;
    packet.is_home_invalid = is_home_invalid;
    packet.fly_time_s = fly_time_s;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_CRC);
}

/**
 * @brief Pack a mission_heartbeat_1hz message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param status MAVLink status structure
 * @param msg The MAVLink message to compress the data into
 *
 * @param seq  seq序列号
 * @param drone_type  飞机类型 DroneType
 * @param drone_id  飞机id
 * @param fcs_flight_mode  飞行模式FlightControlMode
 * @param fcs_arm  解锁状态bool
 * @param smart_mode  飞机工作模式，主模式.
 * @param smart_mode_status  工作状态
 * @param is_home_invalid  home点无效
 * @param home_x_lat  home点纬度 = home_x_lat * 1e-7
 * @param home_y_lon  home点经度 = home_y_lon * 1e-7
 * @param home_z_alt  home点高度 = home_z_alt * 1e-3
 * @param backup_home_lat  备降点0纬度 = backup_home_lat * 1e-7
 * @param backup_home_lon  备降点0经度 = backup_home_lon * 1e-7
 * @param backup_home_alt  备降点0高度 = backup_home_alt * 1e-3
 * @param fly_time_s  飞行时间
 * @param backup_home_valid  备降点有效,TRUE,Boolean
 * @param start_time_s  启动时间
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_mission_heartbeat_1hz_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
                               int64_t seq, uint8_t drone_type, uint8_t drone_id, uint8_t fcs_flight_mode, uint8_t fcs_arm, uint8_t smart_mode, uint8_t smart_mode_status, uint8_t is_home_invalid, int32_t home_x_lat, int32_t home_y_lon, int32_t home_z_alt, int32_t backup_home_lat, int32_t backup_home_lon, int32_t backup_home_alt, uint8_t fly_time_s, int32_t backup_home_valid, int32_t start_time_s)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN];
    _mav_put_int64_t(buf, 0, seq);
    _mav_put_int32_t(buf, 8, home_x_lat);
    _mav_put_int32_t(buf, 12, home_y_lon);
    _mav_put_int32_t(buf, 16, home_z_alt);
    _mav_put_int32_t(buf, 20, backup_home_lat);
    _mav_put_int32_t(buf, 24, backup_home_lon);
    _mav_put_int32_t(buf, 28, backup_home_alt);
    _mav_put_int32_t(buf, 32, backup_home_valid);
    _mav_put_int32_t(buf, 36, start_time_s);
    _mav_put_uint8_t(buf, 40, drone_type);
    _mav_put_uint8_t(buf, 41, drone_id);
    _mav_put_uint8_t(buf, 42, fcs_flight_mode);
    _mav_put_uint8_t(buf, 43, fcs_arm);
    _mav_put_uint8_t(buf, 44, smart_mode);
    _mav_put_uint8_t(buf, 45, smart_mode_status);
    _mav_put_uint8_t(buf, 46, is_home_invalid);
    _mav_put_uint8_t(buf, 47, fly_time_s);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN);
#else
    mavlink_mission_heartbeat_1hz_t packet;
    packet.seq = seq;
    packet.home_x_lat = home_x_lat;
    packet.home_y_lon = home_y_lon;
    packet.home_z_alt = home_z_alt;
    packet.backup_home_lat = backup_home_lat;
    packet.backup_home_lon = backup_home_lon;
    packet.backup_home_alt = backup_home_alt;
    packet.backup_home_valid = backup_home_valid;
    packet.start_time_s = start_time_s;
    packet.drone_type = drone_type;
    packet.drone_id = drone_id;
    packet.fcs_flight_mode = fcs_flight_mode;
    packet.fcs_arm = fcs_arm;
    packet.smart_mode = smart_mode;
    packet.smart_mode_status = smart_mode_status;
    packet.is_home_invalid = is_home_invalid;
    packet.fly_time_s = fly_time_s;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ;
#if MAVLINK_CRC_EXTRA
    return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_CRC);
#else
    return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN);
#endif
}

/**
 * @brief Pack a mission_heartbeat_1hz message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param seq  seq序列号
 * @param drone_type  飞机类型 DroneType
 * @param drone_id  飞机id
 * @param fcs_flight_mode  飞行模式FlightControlMode
 * @param fcs_arm  解锁状态bool
 * @param smart_mode  飞机工作模式，主模式.
 * @param smart_mode_status  工作状态
 * @param is_home_invalid  home点无效
 * @param home_x_lat  home点纬度 = home_x_lat * 1e-7
 * @param home_y_lon  home点经度 = home_y_lon * 1e-7
 * @param home_z_alt  home点高度 = home_z_alt * 1e-3
 * @param backup_home_lat  备降点0纬度 = backup_home_lat * 1e-7
 * @param backup_home_lon  备降点0经度 = backup_home_lon * 1e-7
 * @param backup_home_alt  备降点0高度 = backup_home_alt * 1e-3
 * @param fly_time_s  飞行时间
 * @param backup_home_valid  备降点有效,TRUE,Boolean
 * @param start_time_s  启动时间
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_mission_heartbeat_1hz_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   int64_t seq,uint8_t drone_type,uint8_t drone_id,uint8_t fcs_flight_mode,uint8_t fcs_arm,uint8_t smart_mode,uint8_t smart_mode_status,uint8_t is_home_invalid,int32_t home_x_lat,int32_t home_y_lon,int32_t home_z_alt,int32_t backup_home_lat,int32_t backup_home_lon,int32_t backup_home_alt,uint8_t fly_time_s,int32_t backup_home_valid,int32_t start_time_s)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN];
    _mav_put_int64_t(buf, 0, seq);
    _mav_put_int32_t(buf, 8, home_x_lat);
    _mav_put_int32_t(buf, 12, home_y_lon);
    _mav_put_int32_t(buf, 16, home_z_alt);
    _mav_put_int32_t(buf, 20, backup_home_lat);
    _mav_put_int32_t(buf, 24, backup_home_lon);
    _mav_put_int32_t(buf, 28, backup_home_alt);
    _mav_put_int32_t(buf, 32, backup_home_valid);
    _mav_put_int32_t(buf, 36, start_time_s);
    _mav_put_uint8_t(buf, 40, drone_type);
    _mav_put_uint8_t(buf, 41, drone_id);
    _mav_put_uint8_t(buf, 42, fcs_flight_mode);
    _mav_put_uint8_t(buf, 43, fcs_arm);
    _mav_put_uint8_t(buf, 44, smart_mode);
    _mav_put_uint8_t(buf, 45, smart_mode_status);
    _mav_put_uint8_t(buf, 46, is_home_invalid);
    _mav_put_uint8_t(buf, 47, fly_time_s);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN);
#else
    mavlink_mission_heartbeat_1hz_t packet;
    packet.seq = seq;
    packet.home_x_lat = home_x_lat;
    packet.home_y_lon = home_y_lon;
    packet.home_z_alt = home_z_alt;
    packet.backup_home_lat = backup_home_lat;
    packet.backup_home_lon = backup_home_lon;
    packet.backup_home_alt = backup_home_alt;
    packet.backup_home_valid = backup_home_valid;
    packet.start_time_s = start_time_s;
    packet.drone_type = drone_type;
    packet.drone_id = drone_id;
    packet.fcs_flight_mode = fcs_flight_mode;
    packet.fcs_arm = fcs_arm;
    packet.smart_mode = smart_mode;
    packet.smart_mode_status = smart_mode_status;
    packet.is_home_invalid = is_home_invalid;
    packet.fly_time_s = fly_time_s;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_CRC);
}

/**
 * @brief Encode a mission_heartbeat_1hz struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param mission_heartbeat_1hz C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_mission_heartbeat_1hz_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_heartbeat_1hz_t* mission_heartbeat_1hz)
{
    return mavlink_msg_mission_heartbeat_1hz_pack(system_id, component_id, msg, mission_heartbeat_1hz->seq, mission_heartbeat_1hz->drone_type, mission_heartbeat_1hz->drone_id, mission_heartbeat_1hz->fcs_flight_mode, mission_heartbeat_1hz->fcs_arm, mission_heartbeat_1hz->smart_mode, mission_heartbeat_1hz->smart_mode_status, mission_heartbeat_1hz->is_home_invalid, mission_heartbeat_1hz->home_x_lat, mission_heartbeat_1hz->home_y_lon, mission_heartbeat_1hz->home_z_alt, mission_heartbeat_1hz->backup_home_lat, mission_heartbeat_1hz->backup_home_lon, mission_heartbeat_1hz->backup_home_alt, mission_heartbeat_1hz->fly_time_s, mission_heartbeat_1hz->backup_home_valid, mission_heartbeat_1hz->start_time_s);
}

/**
 * @brief Encode a mission_heartbeat_1hz struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param mission_heartbeat_1hz C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_mission_heartbeat_1hz_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_heartbeat_1hz_t* mission_heartbeat_1hz)
{
    return mavlink_msg_mission_heartbeat_1hz_pack_chan(system_id, component_id, chan, msg, mission_heartbeat_1hz->seq, mission_heartbeat_1hz->drone_type, mission_heartbeat_1hz->drone_id, mission_heartbeat_1hz->fcs_flight_mode, mission_heartbeat_1hz->fcs_arm, mission_heartbeat_1hz->smart_mode, mission_heartbeat_1hz->smart_mode_status, mission_heartbeat_1hz->is_home_invalid, mission_heartbeat_1hz->home_x_lat, mission_heartbeat_1hz->home_y_lon, mission_heartbeat_1hz->home_z_alt, mission_heartbeat_1hz->backup_home_lat, mission_heartbeat_1hz->backup_home_lon, mission_heartbeat_1hz->backup_home_alt, mission_heartbeat_1hz->fly_time_s, mission_heartbeat_1hz->backup_home_valid, mission_heartbeat_1hz->start_time_s);
}

/**
 * @brief Encode a mission_heartbeat_1hz struct with provided status structure
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param status MAVLink status structure
 * @param msg The MAVLink message to compress the data into
 * @param mission_heartbeat_1hz C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_mission_heartbeat_1hz_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_mission_heartbeat_1hz_t* mission_heartbeat_1hz)
{
    return mavlink_msg_mission_heartbeat_1hz_pack_status(system_id, component_id, _status, msg,  mission_heartbeat_1hz->seq, mission_heartbeat_1hz->drone_type, mission_heartbeat_1hz->drone_id, mission_heartbeat_1hz->fcs_flight_mode, mission_heartbeat_1hz->fcs_arm, mission_heartbeat_1hz->smart_mode, mission_heartbeat_1hz->smart_mode_status, mission_heartbeat_1hz->is_home_invalid, mission_heartbeat_1hz->home_x_lat, mission_heartbeat_1hz->home_y_lon, mission_heartbeat_1hz->home_z_alt, mission_heartbeat_1hz->backup_home_lat, mission_heartbeat_1hz->backup_home_lon, mission_heartbeat_1hz->backup_home_alt, mission_heartbeat_1hz->fly_time_s, mission_heartbeat_1hz->backup_home_valid, mission_heartbeat_1hz->start_time_s);
}

/**
 * @brief Send a mission_heartbeat_1hz message
 * @param chan MAVLink channel to send the message
 *
 * @param seq  seq序列号
 * @param drone_type  飞机类型 DroneType
 * @param drone_id  飞机id
 * @param fcs_flight_mode  飞行模式FlightControlMode
 * @param fcs_arm  解锁状态bool
 * @param smart_mode  飞机工作模式，主模式.
 * @param smart_mode_status  工作状态
 * @param is_home_invalid  home点无效
 * @param home_x_lat  home点纬度 = home_x_lat * 1e-7
 * @param home_y_lon  home点经度 = home_y_lon * 1e-7
 * @param home_z_alt  home点高度 = home_z_alt * 1e-3
 * @param backup_home_lat  备降点0纬度 = backup_home_lat * 1e-7
 * @param backup_home_lon  备降点0经度 = backup_home_lon * 1e-7
 * @param backup_home_alt  备降点0高度 = backup_home_alt * 1e-3
 * @param fly_time_s  飞行时间
 * @param backup_home_valid  备降点有效,TRUE,Boolean
 * @param start_time_s  启动时间
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_mission_heartbeat_1hz_send(mavlink_channel_t chan, int64_t seq, uint8_t drone_type, uint8_t drone_id, uint8_t fcs_flight_mode, uint8_t fcs_arm, uint8_t smart_mode, uint8_t smart_mode_status, uint8_t is_home_invalid, int32_t home_x_lat, int32_t home_y_lon, int32_t home_z_alt, int32_t backup_home_lat, int32_t backup_home_lon, int32_t backup_home_alt, uint8_t fly_time_s, int32_t backup_home_valid, int32_t start_time_s)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN];
    _mav_put_int64_t(buf, 0, seq);
    _mav_put_int32_t(buf, 8, home_x_lat);
    _mav_put_int32_t(buf, 12, home_y_lon);
    _mav_put_int32_t(buf, 16, home_z_alt);
    _mav_put_int32_t(buf, 20, backup_home_lat);
    _mav_put_int32_t(buf, 24, backup_home_lon);
    _mav_put_int32_t(buf, 28, backup_home_alt);
    _mav_put_int32_t(buf, 32, backup_home_valid);
    _mav_put_int32_t(buf, 36, start_time_s);
    _mav_put_uint8_t(buf, 40, drone_type);
    _mav_put_uint8_t(buf, 41, drone_id);
    _mav_put_uint8_t(buf, 42, fcs_flight_mode);
    _mav_put_uint8_t(buf, 43, fcs_arm);
    _mav_put_uint8_t(buf, 44, smart_mode);
    _mav_put_uint8_t(buf, 45, smart_mode_status);
    _mav_put_uint8_t(buf, 46, is_home_invalid);
    _mav_put_uint8_t(buf, 47, fly_time_s);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ, buf, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_CRC);
#else
    mavlink_mission_heartbeat_1hz_t packet;
    packet.seq = seq;
    packet.home_x_lat = home_x_lat;
    packet.home_y_lon = home_y_lon;
    packet.home_z_alt = home_z_alt;
    packet.backup_home_lat = backup_home_lat;
    packet.backup_home_lon = backup_home_lon;
    packet.backup_home_alt = backup_home_alt;
    packet.backup_home_valid = backup_home_valid;
    packet.start_time_s = start_time_s;
    packet.drone_type = drone_type;
    packet.drone_id = drone_id;
    packet.fcs_flight_mode = fcs_flight_mode;
    packet.fcs_arm = fcs_arm;
    packet.smart_mode = smart_mode;
    packet.smart_mode_status = smart_mode_status;
    packet.is_home_invalid = is_home_invalid;
    packet.fly_time_s = fly_time_s;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ, (const char *)&packet, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_CRC);
#endif
}

/**
 * @brief Send a mission_heartbeat_1hz message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_mission_heartbeat_1hz_send_struct(mavlink_channel_t chan, const mavlink_mission_heartbeat_1hz_t* mission_heartbeat_1hz)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_mission_heartbeat_1hz_send(chan, mission_heartbeat_1hz->seq, mission_heartbeat_1hz->drone_type, mission_heartbeat_1hz->drone_id, mission_heartbeat_1hz->fcs_flight_mode, mission_heartbeat_1hz->fcs_arm, mission_heartbeat_1hz->smart_mode, mission_heartbeat_1hz->smart_mode_status, mission_heartbeat_1hz->is_home_invalid, mission_heartbeat_1hz->home_x_lat, mission_heartbeat_1hz->home_y_lon, mission_heartbeat_1hz->home_z_alt, mission_heartbeat_1hz->backup_home_lat, mission_heartbeat_1hz->backup_home_lon, mission_heartbeat_1hz->backup_home_alt, mission_heartbeat_1hz->fly_time_s, mission_heartbeat_1hz->backup_home_valid, mission_heartbeat_1hz->start_time_s);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ, (const char *)mission_heartbeat_1hz, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_CRC);
#endif
}

#if MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This variant of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_mission_heartbeat_1hz_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  int64_t seq, uint8_t drone_type, uint8_t drone_id, uint8_t fcs_flight_mode, uint8_t fcs_arm, uint8_t smart_mode, uint8_t smart_mode_status, uint8_t is_home_invalid, int32_t home_x_lat, int32_t home_y_lon, int32_t home_z_alt, int32_t backup_home_lat, int32_t backup_home_lon, int32_t backup_home_alt, uint8_t fly_time_s, int32_t backup_home_valid, int32_t start_time_s)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_int64_t(buf, 0, seq);
    _mav_put_int32_t(buf, 8, home_x_lat);
    _mav_put_int32_t(buf, 12, home_y_lon);
    _mav_put_int32_t(buf, 16, home_z_alt);
    _mav_put_int32_t(buf, 20, backup_home_lat);
    _mav_put_int32_t(buf, 24, backup_home_lon);
    _mav_put_int32_t(buf, 28, backup_home_alt);
    _mav_put_int32_t(buf, 32, backup_home_valid);
    _mav_put_int32_t(buf, 36, start_time_s);
    _mav_put_uint8_t(buf, 40, drone_type);
    _mav_put_uint8_t(buf, 41, drone_id);
    _mav_put_uint8_t(buf, 42, fcs_flight_mode);
    _mav_put_uint8_t(buf, 43, fcs_arm);
    _mav_put_uint8_t(buf, 44, smart_mode);
    _mav_put_uint8_t(buf, 45, smart_mode_status);
    _mav_put_uint8_t(buf, 46, is_home_invalid);
    _mav_put_uint8_t(buf, 47, fly_time_s);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ, buf, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_CRC);
#else
    mavlink_mission_heartbeat_1hz_t *packet = (mavlink_mission_heartbeat_1hz_t *)msgbuf;
    packet->seq = seq;
    packet->home_x_lat = home_x_lat;
    packet->home_y_lon = home_y_lon;
    packet->home_z_alt = home_z_alt;
    packet->backup_home_lat = backup_home_lat;
    packet->backup_home_lon = backup_home_lon;
    packet->backup_home_alt = backup_home_alt;
    packet->backup_home_valid = backup_home_valid;
    packet->start_time_s = start_time_s;
    packet->drone_type = drone_type;
    packet->drone_id = drone_id;
    packet->fcs_flight_mode = fcs_flight_mode;
    packet->fcs_arm = fcs_arm;
    packet->smart_mode = smart_mode;
    packet->smart_mode_status = smart_mode_status;
    packet->is_home_invalid = is_home_invalid;
    packet->fly_time_s = fly_time_s;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ, (const char *)packet, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_MIN_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_CRC);
#endif
}
#endif

#endif

// MESSAGE MISSION_HEARTBEAT_1HZ UNPACKING


/**
 * @brief Get field seq from mission_heartbeat_1hz message
 *
 * @return  seq序列号
 */
static inline int64_t mavlink_msg_mission_heartbeat_1hz_get_seq(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int64_t(msg,  0);
}

/**
 * @brief Get field drone_type from mission_heartbeat_1hz message
 *
 * @return  飞机类型 DroneType
 */
static inline uint8_t mavlink_msg_mission_heartbeat_1hz_get_drone_type(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  40);
}

/**
 * @brief Get field drone_id from mission_heartbeat_1hz message
 *
 * @return  飞机id
 */
static inline uint8_t mavlink_msg_mission_heartbeat_1hz_get_drone_id(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  41);
}

/**
 * @brief Get field fcs_flight_mode from mission_heartbeat_1hz message
 *
 * @return  飞行模式FlightControlMode
 */
static inline uint8_t mavlink_msg_mission_heartbeat_1hz_get_fcs_flight_mode(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  42);
}

/**
 * @brief Get field fcs_arm from mission_heartbeat_1hz message
 *
 * @return  解锁状态bool
 */
static inline uint8_t mavlink_msg_mission_heartbeat_1hz_get_fcs_arm(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  43);
}

/**
 * @brief Get field smart_mode from mission_heartbeat_1hz message
 *
 * @return  飞机工作模式，主模式.
 */
static inline uint8_t mavlink_msg_mission_heartbeat_1hz_get_smart_mode(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  44);
}

/**
 * @brief Get field smart_mode_status from mission_heartbeat_1hz message
 *
 * @return  工作状态
 */
static inline uint8_t mavlink_msg_mission_heartbeat_1hz_get_smart_mode_status(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  45);
}

/**
 * @brief Get field is_home_invalid from mission_heartbeat_1hz message
 *
 * @return  home点无效
 */
static inline uint8_t mavlink_msg_mission_heartbeat_1hz_get_is_home_invalid(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  46);
}

/**
 * @brief Get field home_x_lat from mission_heartbeat_1hz message
 *
 * @return  home点纬度 = home_x_lat * 1e-7
 */
static inline int32_t mavlink_msg_mission_heartbeat_1hz_get_home_x_lat(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  8);
}

/**
 * @brief Get field home_y_lon from mission_heartbeat_1hz message
 *
 * @return  home点经度 = home_y_lon * 1e-7
 */
static inline int32_t mavlink_msg_mission_heartbeat_1hz_get_home_y_lon(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  12);
}

/**
 * @brief Get field home_z_alt from mission_heartbeat_1hz message
 *
 * @return  home点高度 = home_z_alt * 1e-3
 */
static inline int32_t mavlink_msg_mission_heartbeat_1hz_get_home_z_alt(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  16);
}

/**
 * @brief Get field backup_home_lat from mission_heartbeat_1hz message
 *
 * @return  备降点0纬度 = backup_home_lat * 1e-7
 */
static inline int32_t mavlink_msg_mission_heartbeat_1hz_get_backup_home_lat(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  20);
}

/**
 * @brief Get field backup_home_lon from mission_heartbeat_1hz message
 *
 * @return  备降点0经度 = backup_home_lon * 1e-7
 */
static inline int32_t mavlink_msg_mission_heartbeat_1hz_get_backup_home_lon(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  24);
}

/**
 * @brief Get field backup_home_alt from mission_heartbeat_1hz message
 *
 * @return  备降点0高度 = backup_home_alt * 1e-3
 */
static inline int32_t mavlink_msg_mission_heartbeat_1hz_get_backup_home_alt(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  28);
}

/**
 * @brief Get field fly_time_s from mission_heartbeat_1hz message
 *
 * @return  飞行时间
 */
static inline uint8_t mavlink_msg_mission_heartbeat_1hz_get_fly_time_s(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint8_t(msg,  47);
}

/**
 * @brief Get field backup_home_valid from mission_heartbeat_1hz message
 *
 * @return  备降点有效,TRUE,Boolean
 */
static inline int32_t mavlink_msg_mission_heartbeat_1hz_get_backup_home_valid(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  32);
}

/**
 * @brief Get field start_time_s from mission_heartbeat_1hz message
 *
 * @return  启动时间
 */
static inline int32_t mavlink_msg_mission_heartbeat_1hz_get_start_time_s(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int32_t(msg,  36);
}

/**
 * @brief Decode a mission_heartbeat_1hz message into a struct
 *
 * @param msg The message to decode
 * @param mission_heartbeat_1hz C-struct to decode the message contents into
 */
static inline void mavlink_msg_mission_heartbeat_1hz_decode(const mavlink_message_t* msg, mavlink_mission_heartbeat_1hz_t* mission_heartbeat_1hz)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mission_heartbeat_1hz->seq = mavlink_msg_mission_heartbeat_1hz_get_seq(msg);
    mission_heartbeat_1hz->home_x_lat = mavlink_msg_mission_heartbeat_1hz_get_home_x_lat(msg);
    mission_heartbeat_1hz->home_y_lon = mavlink_msg_mission_heartbeat_1hz_get_home_y_lon(msg);
    mission_heartbeat_1hz->home_z_alt = mavlink_msg_mission_heartbeat_1hz_get_home_z_alt(msg);
    mission_heartbeat_1hz->backup_home_lat = mavlink_msg_mission_heartbeat_1hz_get_backup_home_lat(msg);
    mission_heartbeat_1hz->backup_home_lon = mavlink_msg_mission_heartbeat_1hz_get_backup_home_lon(msg);
    mission_heartbeat_1hz->backup_home_alt = mavlink_msg_mission_heartbeat_1hz_get_backup_home_alt(msg);
    mission_heartbeat_1hz->backup_home_valid = mavlink_msg_mission_heartbeat_1hz_get_backup_home_valid(msg);
    mission_heartbeat_1hz->start_time_s = mavlink_msg_mission_heartbeat_1hz_get_start_time_s(msg);
    mission_heartbeat_1hz->drone_type = mavlink_msg_mission_heartbeat_1hz_get_drone_type(msg);
    mission_heartbeat_1hz->drone_id = mavlink_msg_mission_heartbeat_1hz_get_drone_id(msg);
    mission_heartbeat_1hz->fcs_flight_mode = mavlink_msg_mission_heartbeat_1hz_get_fcs_flight_mode(msg);
    mission_heartbeat_1hz->fcs_arm = mavlink_msg_mission_heartbeat_1hz_get_fcs_arm(msg);
    mission_heartbeat_1hz->smart_mode = mavlink_msg_mission_heartbeat_1hz_get_smart_mode(msg);
    mission_heartbeat_1hz->smart_mode_status = mavlink_msg_mission_heartbeat_1hz_get_smart_mode_status(msg);
    mission_heartbeat_1hz->is_home_invalid = mavlink_msg_mission_heartbeat_1hz_get_is_home_invalid(msg);
    mission_heartbeat_1hz->fly_time_s = mavlink_msg_mission_heartbeat_1hz_get_fly_time_s(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN? msg->len : MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN;
        memset(mission_heartbeat_1hz, 0, MAVLINK_MSG_ID_MISSION_HEARTBEAT_1HZ_LEN);
    memcpy(mission_heartbeat_1hz, _MAV_PAYLOAD(msg), len);
#endif
}
